package dao.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Size entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "size", catalog = "onlinemall")
public class Size implements java.io.Serializable {

	// Fields

	private Short sizeId;
	private String size;
	private Set<PurchaseCommodityInfo> purchaseCommodityInfos = new HashSet<PurchaseCommodityInfo>(
			0);
	private Set<ShelfCommodityInfo> shelfCommodityInfos = new HashSet<ShelfCommodityInfo>(
			0);

	// Constructors

	/** default constructor */
	public Size() {
	}

	/** minimal constructor */
	public Size(String size) {
		this.size = size;
	}

	/** full constructor */
	public Size(String size, Set<PurchaseCommodityInfo> purchaseCommodityInfos,
			Set<ShelfCommodityInfo> shelfCommodityInfos) {
		this.size = size;
		this.purchaseCommodityInfos = purchaseCommodityInfos;
		this.shelfCommodityInfos = shelfCommodityInfos;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "size_id", unique = true, nullable = false)
	public Short getSizeId() {
		return this.sizeId;
	}

	public void setSizeId(Short sizeId) {
		this.sizeId = sizeId;
	}

	@Column(name = "size", nullable = false, length = 20)
	public String getSize() {
		return this.size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "size")
	public Set<PurchaseCommodityInfo> getPurchaseCommodityInfos() {
		return this.purchaseCommodityInfos;
	}

	public void setPurchaseCommodityInfos(
			Set<PurchaseCommodityInfo> purchaseCommodityInfos) {
		this.purchaseCommodityInfos = purchaseCommodityInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "size")
	public Set<ShelfCommodityInfo> getShelfCommodityInfos() {
		return this.shelfCommodityInfos;
	}

	public void setShelfCommodityInfos(
			Set<ShelfCommodityInfo> shelfCommodityInfos) {
		this.shelfCommodityInfos = shelfCommodityInfos;
	}

}